// @ts-nocheck

const enquirer = require('enquirer')
const chalk = require('chalk')
async function userConfirm(message) {
  let { answer } = await enquirer.prompt({ type: 'confirm', name: 'answer', message });
  return !!answer;
}

async function userSelect(message, choices) {
  const res = await new enquirer.Select({
    name: 'value',
    styles: { primary: chalk.yellowBright },
    message,
    choices,
  }).run();
  return res;
}


async function multiSelect(message, choices) {
  const res = await new enquirer.MultiSelect({
    name: 'value',
    message,
    choices,
  }).run();
  return res;
}

function boxen(text) {
  const boxen = require('boxen');
  const options = {
    padding: 1,
    margin: 1,
    borderStyle: 'round',
    borderColor: 'yellow',
    backgroundColor: '#555555',
  };
  return boxen(lines, options);

}

module.exports = {
  userSelect,
  userConfirm,
  multiSelect,
  boxen
} 